package com.atguigu.gmall.activity.controller;

import com.atguigu.gmall.common.result.Result;
import com.github.benmanes.caffeine.cache.Cache;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ConcurrentMap;

/**
 * @author: atguigu
 * @create: 2023-09-22 16:48
 */
@RestController
@RequestMapping("/api")
public class TestController {

    @Autowired
    private Cache<String, String> seckillGoodsCache;

    @GetMapping("/getCache")
    public Result getCache() {
        ConcurrentMap<@NonNull String, @NonNull String> map = seckillGoodsCache.asMap();
        return Result.ok(map);
    }

}
